package com.example.demo.utils;

import java.util.Random;

public class RandomUtils {
    public static String generateRandomPasscode(int length) {
        String characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
        StringBuilder passcode = new StringBuilder();
        Random random = new Random();
        for (int i = 0; i < length; i++) {
            int index = random.nextInt(characters.length());
            passcode.append(characters.charAt(index));
        }
        return passcode.toString();
    }
}
